package com.exchange.mapper;

import com.exchange.dto.UserDto;
import com.exchange.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Mapper
@Repository
public interface UserMapper {
    
    User selectById(Long id);
    
    User selectByUsername(String username);
    
    User selectByEmail(String email);
    
    List<UserDto> selectAllUsers();
    
    int insert(User user);
    
    int update(User user);
    
    int deleteById(Long id);
    
    boolean existsByUsername(String username);
    
    boolean existsByEmail(String email);
}